-----------------------------------------------------------------------------
--
-- Module      :  Data.TypeLevel.Digit
-- Copyright   :
-- License     :  AllRightsReserved
--
-- Maintainer  :  eduard.sergeev@gmail.com
-- Stability   :  Highly Experimental
-- Portability :
--
-- Type-level decimal digit data
--
-----------------------------------------------------------------------------

{-# LANGUAGE NoImplicitPrelude, TypeFamilies, TypeOperators, UndecidableInstances,
ScopedTypeVariables, FlexibleInstances #-}


module Data.TypeLevel.Bit (

   D0,
   D1,
   D2,
   D3,
   D4,
   D5,
   D6,
   D7,
   D8,
   D9,

   (:==:),

   (:<=:),

) where

import Prelude (Show(show))

import Data.TypeLevel.Families
import Data.TypeLevel.Class
import Data.TypeLevel.Boolean


data D0 
data D1
data D2
data D3
data D4
data D5
data D6
data D7
data D8
data D9


-- * Type-level "Eq" implementation
type instance B0 :==: B0 = True
type instance B0 :==: B1 = False
type instance B1 :==: B0 = False
type instance B1 :==: B1 = True

-- * Type-level "Ord" implementation
type instance B0 :<=: B0 = True
type instance B0 :<=: B1 = True
type instance B1 :<=: B0 = False
type instance B1 :<=: B1 = True


-- | Some normal typeclasse instances
instance Numerable B0 where
    toNumber _ = 0

instance Numerable B1 where
    toNumber _ = 1


instance Show B0 where
    show _ = "0"

instance Show B1 where
    show _ = "1"